package org.poseidon.common.utils.sign;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;

/**

 * @Date: 2022/1/25 15:52
 * @Description:
 */
public class Base64Util {

    private final static String salt="QWERTYUIOPMNBVCX";

    public static String encode(String encode){
        return salt+Base64.encode(encode.getBytes());
    }
    public static String decode(String decode) throws UnsupportedEncodingException {
        String decoded = decode.replace(salt,"");
        byte[] pwd = Base64.decode(decoded);
        return new String(pwd,"ascii");
    }

}
